package com.four.controller;

import com.four.pojo.Coment;
import com.four.service.IComentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author 王森
 * @create 2021-10-29 15:56
 */


@Controller("comentMenController")
public class ComentMenController {

    @Autowired
    @Qualifier(value = "comentService")
    private IComentService iComentService;


    @RequestMapping("/findAllComentMen")
    public String findAllComentMen(Model model){
        System.out.println(11111111);
        List<Coment> list=iComentService.findAllComentMen();;
        model.addAttribute("list",list);
        return "bosssystem/Comment.jsp";
    }

    @RequestMapping("findHpMen")
    public String findHpMen(Model model){
        List<Coment> list = iComentService.findHpMen();
        model.addAttribute("list" , list);
        return "bosssystem/Comment1.jsp";
    }

    @RequestMapping("findCpMen")
    public String findCpMen(Model model){
        List<Coment> list = iComentService.findCpMen();
        model.addAttribute("list" , list);
        System.out.println(11111);

        return "bosssystem/Comment2.jsp";
    }

    @RequestMapping("findByIdComentMen")
    public String findByIdComentMen(Model model , int rid){
        Coment coment = iComentService.findByIdComent(rid);
        System.out.println(rid);
        model.addAttribute("coment" , coment);
        return "view_Comment.jsp";
    }

}
